package day14;

import java.util.LinkedList;

public class MyStack {
	private LinkedList linkedList=new LinkedList();
	public boolean empty(){
		return linkedList.isEmpty();
	}
	public void push(Object o){
		linkedList.addFirst(o);
	}
	public Object pop(){
		return linkedList.poll();
	}
	public Object peek(){
		return linkedList.peek();
	}
	public static void main(String[] args) {
		MyStack ms = new MyStack();
		ms.push("aaa");
		ms.push("bbb");
		ms.push("ccc");
		while(!ms.empty()){
			System.out.println(ms.pop());
		}
	}
}
